import { IRouteComponentProps, Redirect } from 'umi';
// 全局layout，用来添加全局的公共的内容
// 可以用它来做重定向

export default function Layout({
  children,
  location,
  route,
  history,
  match,
}: IRouteComponentProps) {
  // console.log(location);
  // return (
  // <>
  //   {children}
  //   <footer>@baidu</footer>
  // </>
  //   children
  // );

  if (location.pathname === '/') {
    return <Redirect to="/home"></Redirect>;
  } else {
    return children;
  }
}
